package com.iv.durian.cloud.api.service;

import com.iv.durian.cloud.LessonDetail;
import com.iv.durian.cloud.facade.LessonDetailFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by zlw on 2018-07-01.
 */
@Service
public class LessonDetailService {
    @Autowired
    private LessonDetailFacade lessonDetailFacade;

    public LessonDetail getById(Integer lessonId){
        return lessonDetailFacade.getById(lessonId);
    }

    public LessonDetail getByName(String lessonName){
        return lessonDetailFacade.getByName(lessonName);
    }

    public void add(LessonDetail lessonDetail){
        lessonDetailFacade.add(lessonDetail);
    }

    public void removeById(Integer lessonId){
        lessonDetailFacade.removeById(lessonId);
    }

    public int updateLessonDetail(LessonDetail lessonDetail){
        return lessonDetailFacade.updateLessonDetail(lessonDetail);
    }

    /*
    public List<LessonDetail> list(@PathVariable("lesson_id")Integer lessonId, @PathVariable("status")Integer status,@PathVariable("offset") Integer offset, @PathVariable("limit") Integer limit);*/

    public int countLessonDetail(Integer lessonId){
        return lessonDetailFacade.countLessonDetail(lessonId);
    }
}
